from io import BytesIO
from pathlib import Path

class InvalidBlobType(Exception):
    """当传入的 blob 类型不符合要求时抛出的异常"""
    
    def __init__(self, actual_type: type):
        self.actual_type = actual_type
        supported_types = (str, Path, bytes, BytesIO)
        super().__init__(
            f"Invalid blob type: {actual_type.__name__}. "
            f"Supported types: {', '.join(t.__name__ for t in supported_types)}"
        )